import 'package:flutter/material.dart';
import 'package:flutter_basic_learning/icon/AliIcon.dart';
import 'package:flutter_basic_learning/utils/CommonWidget.dart';

class IconWidget extends StatelessWidget {
  const IconWidget({super.key});

  Widget renderIcon(IconData icon) {
    Widget body = Icon(icon, size: 40, color: Colors.red);
    return body;
  }

  @override
  Widget build(BuildContext context) {
    return commonScaffold('加载图片', [
      verticalSpacing(10),
      desc('1.Flutter内置Icon图标'),
      renderIcon(Icons.access_alarm),
      verticalSpacing(30),
      desc('2.阿里巴巴图标库自定义图标'),
      commonRow([
        renderIcon(AliIcon.qr_code),
        horizontalSpacing(10),
        renderIcon(AliIcon.app_icon),
        horizontalSpacing(10),
        renderIcon(AliIcon.setting),
        horizontalSpacing(10),
        renderIcon(AliIcon.like),
      ])
    ]);
  }
}
